package com.crm.controller;

import com.crm.constant.dto.BaseFxResponse;
import com.crm.entity.CrmSite;
import com.crm.model.vo.ProjectReportVo;
import com.crm.model.vo.ReportCountVo;
import com.crm.model.vo.StatisticalCountVo;
import com.crm.service.ReportService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @version 1.0
 * @author: CRM_SYSTEM
 * @date: 2022/4/7 21:27
 * @Description:
 */
@RestController
@RequestMapping("/crm/report")
public class ReportController {

    @Autowired
    private ReportService reportService;

    @ApiOperation("首页统计")
    @RequestMapping(value = "/statistical/count", method = RequestMethod.GET)
    public BaseFxResponse<StatisticalCountVo> statisticalCount() {
        return BaseFxResponse.success(reportService.statisticalCount());
    }

    @ApiOperation("统计各月份项目总数")
    @RequestMapping(value = "/project/month", method = RequestMethod.GET)
    public BaseFxResponse<List<ProjectReportVo>> projectMonth() {
        return BaseFxResponse.success(reportService.projectMonth());
    }

    @ApiOperation("统计预约状态数量")
    @RequestMapping(value = "/order/count", method = RequestMethod.GET)
    public BaseFxResponse<List<ReportCountVo>> orderCount() {
        return BaseFxResponse.success(reportService.orderCount());
    }

    @ApiOperation("统计项目状态数量")
    @RequestMapping(value = "/project/count", method = RequestMethod.GET)
    public BaseFxResponse<List<ReportCountVo>> projectCount() {
        return BaseFxResponse.success(reportService.projectCount());
    }

    @ApiOperation("统计各月份场地总数")
    @RequestMapping(value = "/site/month/count", method = RequestMethod.GET)
    public BaseFxResponse<List<ReportCountVo>> siteMonthCount() {
        return BaseFxResponse.success(reportService.siteMonthCount());
    }
}
